package com.wayhome.springframework.beans.factory.support;

import com.wayhome.springframework.beans.BeanException;
import com.wayhome.springframework.beans.factory.config.BeanDefinition;

import java.lang.reflect.Constructor;

public interface InstantiationStrategy {

    /**
     * 实例化策略模板类
     *
     * @param beanName       实例名称
     * @param beanDefinition bean 定义
     * @param ctor           构造器
     * @param args           参数
     * @return 实例对象
     * @throws BeanException 抛出异常
     */
    Object instantiate(String beanName, BeanDefinition beanDefinition, Constructor ctor, Object[] args) throws BeanException;
}
